how to iterate through images in a folder python

39

how to iterate through images in a folder python -

import os
directory = 'the/directory/you/want/to/use'

for filename in os.listdir(directory):
    if filename.endswith(".txt"):
      #do smth
      continue
    else:
    continue

Comments

Submit
0 Comments